| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Node.h
1 // Node.h
3 //
5
6 namespace nkGraphics
7 {
15 class Node : public nkExport::Exportable
16 {
17 public :
18
19 // Destructor
23 virtual ~Node () ;
24
25 // Position
31 virtual void setPositionRelative (const nkMaths::Vector& value) ;
37 virtual void setPositionAbsolute (const nkMaths::Vector& value) ;
43 virtual void translateRelative (const nkMaths::Vector& value) ;
49 virtual void translateAbsolute (const nkMaths::Vector& value) ;
53 nkMaths::Vector getPositionRelative () const ;
57 nkMaths::Vector getPositionAbsolute () ;
58
59 // Orientation
65 virtual void setOrientationRelative (const nkMaths::Quaternion& value) ;
71 virtual void setOrientationAbsolute (const nkMaths::Quaternion& value) ;
77 virtual void rotateRelative (const nkMaths::Quaternion& value) ;
83 virtual void rotateAbsolute (const nkMaths::Quaternion& value) ;
87 nkMaths::Quaternion getOrientationRelative () const ;
91 nkMaths::Quaternion getOrientationAbsolute () ;
92
93 // Scale
99 virtual void setScaleRelative (const nkMaths::Vector& value) ;
105 virtual void setScaleAbsolute (const nkMaths::Vector& value) ;
111 virtual void applyScale (const nkMaths::Vector& value) ;
115 nkMaths::Vector getScaleRelative () const ;
119 nkMaths::Vector getScaleAbsolute () ;
120
121 // Transformation
127 void setRelativeTransform (const nkMaths::Matrix& value) ;
134 void setAbsoluteTransform (const nkMaths::Matrix& value) ;
138 nkMaths::Matrix getRelativeTransform () ;
142 nkMaths::Matrix getAbsoluteTransform () ;
147 void updateTransformations () ;
152 void dispatchDirtyTransform () ;
160 bool getTransformDirty () const ;
161
162 // Axis
166 nkMaths::Vector getAbsoluteUp () ;
170 nkMaths::Vector getAbsoluteFront () ;
174 nkMaths::Vector getAbsoluteRight () ;
175
176 // Hierarchy
183 void setParentNode (Node* parent) ;
187 Node* getParentNode () const ;
192 Node* getChildNode (unsigned int index) const ;
196 unsigned int getNumChildNode () const ;
197
198 // Naming
204 void setName (nkMemory::StringView value) ;
208 nkMemory::StringView getName () const ;
209
210 // Resources
214 bool getHidden () const ;
221 void setHidden (bool value) ;
222
223 // Entity tracking
229 void addEntityToTrack (Entity* entity) ;
235 void stopEntityTracking (Entity* entity) ;
239 unsigned int getTrackedEntityCount () const ;
244 Entity* getTrackedEntity (unsigned int index) const ;
245
246 // Listeners
252 void registerListener (NodeChangeListener* listener) ;
258 void unregisterListener (NodeChangeListener* listener) ;
259
260 // Import / Export
261 virtual void exportClassToTree (nkExport::Node* rootNode) override ;
262 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
263
264 public :
265
266 // Statics
274 static nkMemory::UniquePtr<Node> create (System* system = nullptr) ;
275 } ;
276 }
nkGraphics::Node::unregisterListener
void unregisterListener(NodeChangeListener *listener)
nkGraphics::Node::~Node
virtual ~Node()
nkGraphics::Node::setScaleAbsolute
virtual void setScaleAbsolute(const nkMaths::Vector &value)
nkGraphics::Node::setHidden
void setHidden(bool value)
nkGraphics::Node::getParentNode
Node * getParentNode() const
nkGraphics::System
Main interface with the component system.
Definition: System.h:14
nkGraphics::Node::getOrientationAbsolute
nkMaths::Quaternion getOrientationAbsolute()
nkExport::Exportable
An interface to define objects that can be exported using this component.
Definition: Exportable.h:15
nkGraphics::Node::getAbsoluteUp
nkMaths::Vector getAbsoluteUp()
nkMaths::Quaternion
A quaternion, symbolizing rotations as a 4D vector.
Definition: Quaternion.h:14
nkGraphics::Node::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkGraphics::Node::stopEntityTracking
void stopEntityTracking(Entity *entity)
nkGraphics::Node::getScaleAbsolute
nkMaths::Vector getScaleAbsolute()
nkGraphics::Node::setRelativeTransform
void setRelativeTransform(const nkMaths::Matrix &value)
nkGraphics::Node::getName
nkMemory::StringView getName() const
nkMaths::Matrix
Represents a 4x4 float matrix.
Definition: Matrix.h:15
nkGraphics::Node::setName
void setName(nkMemory::StringView value)
nkGraphics::Node::translateRelative
virtual void translateRelative(const nkMaths::Vector &value)
nkGraphics::Node::setParentNode
void setParentNode(Node *parent)
nkGraphics::Node::setOrientationAbsolute
virtual void setOrientationAbsolute(const nkMaths::Quaternion &value)
nkGraphics::Node::getTrackedEntity
Entity * getTrackedEntity(unsigned int index) const
nkGraphics::Node::setOrientationRelative
virtual void setOrientationRelative(const nkMaths::Quaternion &value)
nkGraphics::Node::getOrientationRelative
nkMaths::Quaternion getOrientationRelative() const
nkGraphics::Node::translateAbsolute
virtual void translateAbsolute(const nkMaths::Vector &value)
nkGraphics::Entity
An entity in a render queue. It drives the shader and possible graph position for a set of renderable...
Definition: Entity.h:15
nkGraphics::Node::getPositionAbsolute
nkMaths::Vector getPositionAbsolute()
nkGraphics::Node::getAbsoluteRight
nkMaths::Vector getAbsoluteRight()
nkGraphics::Node::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkGraphics::Node::addEntityToTrack
void addEntityToTrack(Entity *entity)
nkGraphics::Node::getTransformDirty
bool getTransformDirty() const
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::Node::getTrackedEntityCount
unsigned int getTrackedEntityCount() const
nkGraphics::Node::getRelativeTransform
nkMaths::Matrix getRelativeTransform()
nkGraphics::Node::applyScale
virtual void applyScale(const nkMaths::Vector &value)
nkGraphics::Node::getPositionRelative
nkMaths::Vector getPositionRelative() const
nkGraphics::Node::create
static nkMemory::UniquePtr< Node > create(System *system=nullptr)
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkGraphics::Node::dispatchDirtyTransform
void dispatchDirtyTransform()
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkGraphics::Node::getAbsoluteFront
nkMaths::Vector getAbsoluteFront()
nkGraphics::Node::getHidden
bool getHidden() const
nkGraphics::Node::rotateAbsolute
virtual void rotateAbsolute(const nkMaths::Quaternion &value)
nkGraphics::Node::setPositionAbsolute
virtual void setPositionAbsolute(const nkMaths::Vector &value)
nkGraphics::Node::setAbsoluteTransform
void setAbsoluteTransform(const nkMaths::Matrix &value)
nkGraphics::Node::registerListener
void registerListener(NodeChangeListener *listener)
nkGraphics::Node::updateTransformations
void updateTransformations()
nkGraphics::Node
Represents a node in a scene graph.
Definition: Node.h:16
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::Node::setScaleRelative
virtual void setScaleRelative(const nkMaths::Vector &value)
nkGraphics::Node::getChildNode
Node * getChildNode(unsigned int index) const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkGraphics::Node::setPositionRelative
virtual void setPositionRelative(const nkMaths::Vector &value)
nkGraphics::Node::rotateRelative
virtual void rotateRelative(const nkMaths::Quaternion &value)
nkGraphics::NodeChangeListener
A base class for a listener for node changes.
Definition: NodeChangeListener.h:12
nkGraphics::Node::getNumChildNode
unsigned int getNumChildNode() const
nkGraphics::Node::getAbsoluteTransform
nkMaths::Matrix getAbsoluteTransform()
nkGraphics::Node::getScaleRelative
nkMaths::Vector getScaleRelative() const